package com.lepu.app.fun.grow.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.lepu.app.fun.my.bean.BeanPubContentComment;

public class HotPhoto implements Serializable {

	private static final long serialVersionUID = -5565477078536463601L;
	
	public String AlbumID;
	public String AlbumName;
	public String CreateTime;
	public String AlbumDescription;
	public String UserID;
	public String NickName;
	public String Avatar;
	public String FavourCount;
	
	public String AlbumFrameID;
	public String AlbumCover;
	public String AlbumMusicID;
	
	public String HasFavour;
	
	public ArrayList<HotPhotoImage> PhotoList;
	
	public String CheckStatus;
	
	public static ArrayList<HotPhoto> parseJsonData(String dataString)
	{
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONArray obj2 = (JSONArray) obj1.get("ListInfo");
			
			result = obj2.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}
		
		Gson gson = new Gson();
		ArrayList<HotPhoto> testArraylist = gson.fromJson(result,
				new TypeToken<List<HotPhoto>>() {
				}.getType());
		return testArraylist;
	}
	
	public static HotPhoto parseJsonSimpleData(String dataString)
	{
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONObject obj2 = (JSONObject) obj1.get("DetailInfo");
			
			result = obj2.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}
		
		Gson gson = new Gson();
		HotPhoto item = gson.fromJson(result,
				new TypeToken<HotPhoto>() {
				}.getType());
		return item;
	}
}
